1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
| create schema db_account;
create table db_account.account_tbl ( id int auto_increment primary key, user_id varchar(255) null, money int default 0 null ) charset=utf8;
create table db_account.undo_log ( id bigint auto_increment primary key, branch_id bigint not null, xid varchar(100) not null, context varchar(128) not null, rollback_info longblob not null, log_status int not null, log_created datetime not null, log_modified datetime not null, ext varchar(100) null, constraint ux_undo_log unique (xid, branch_id) ) charset=utf8;
INSERT INTO db_account.account_tbl (id, user_id, money) VALUES (1, '1001', 10000); INSERT INTO db_account.account_tbl (id, user_id, money) VALUES (2, '1002', 10000);
create schema db_order;
create table db_order.order_tbl ( id int auto_increment primary key, user_id varchar(255) null, commodity_code varchar(255) null, count int default 0 null, money int default 0 null ) charset=utf8;
create table db_order.undo_log ( id bigint auto_increment primary key, branch_id bigint not null, xid varchar(100) not null, context varchar(128) not null, rollback_info longblob not null, log_status int not null, log_created datetime not null, log_modified datetime not null, ext varchar(100) null, constraint ux_undo_log unique (xid, branch_id) ) charset=utf8;
create schema db_storage;
create table db_storage.storage_tbl ( id int auto_increment primary key, commodity_code varchar(255) null, count int default 0 null, price decimal(10,2) default 0.00 null comment '单价', constraint commodity_code unique (commodity_code) ) charset=utf8;
create table db_storage.undo_log ( id bigint auto_increment primary key, branch_id bigint not null, xid varchar(100) not null, context varchar(128) not null, rollback_info longblob not null, log_status int not null, log_created datetime not null, log_modified datetime not null, constraint ux_undo_log unique (xid, branch_id) ) charset=utf8;
INSERT INTO db_storage.storage_tbl (id, commodity_code, count, price) VALUES (1, '2001', 900, 2.00);
create schema seata; create table seata.undo_log ( id bigint auto_increment primary key, branch_id bigint not null, xid varchar(100) not null, context varchar(128) not null, rollback_info longblob not null, log_status int not null, log_created datetime not null, log_modified datetime not null, constraint ux_undo_log unique (xid, branch_id) ) charset=utf8;
|